VERSION 5.00 Begin VB.Form frmDrag Caption = "Drag" ClientHeight = 4305 ClientLeft = 60 ClientTop = 345 ClientWidth = 5625 LinkTopic = "Form1" ScaleHeight = 4305 ScaleWidth = 5625 StartUpPosition = 3 'Windows Default Begin VB.PictureBox picOkDrop AutoSize = -1 'True Height = 540 Left = 4200 Picture = "Drag.frx":0000 ScaleHeight = 480 ScaleWidth = 480 TabIndex = 10 Top = 1920 Visible = 0 'False Width = 540 End Begin VB.PictureBox picNoDrop AutoSize = -1 'True Height = 540 Left = 3480 Picture = "Drag.frx":0152 ScaleHeight = 480 ScaleWidth = 480 TabIndex = 9 Top = 1920 Visible = 0 'False Width = 540 End Begin VB.PictureBox picDragTo AutoSize = -1 'True Height = 1770 Index = 2 Left = 3600 ScaleHeight = 1710 ScaleWidth = 1650 TabIndex = 8 Top = 2520 Width = 1710 End Begin VB.PictureBox picDragTo AutoSize = -1 'True Height = 1770 Index = 1 Left = 1800 ScaleHeight = 1710 ScaleWidth = 1650 TabIndex = 6 Top = 2520 Width = 1710 End Begin VB.PictureBox picDragTo AutoSize = -1 'True Height = 1770 Index = 0 Left = 0 ScaleHeight = 1710 ScaleWidth = 1650 TabIndex = 5 Top = 2520 Width = 1710 End Begin VB.PictureBox picDragFrom AutoRedraw = -1 'True AutoSize = -1 'True DragMode = 1 'Automatic Height = 1770 Index = 3 Left = 1800 Picture = "Drag.frx":02A4 ScaleHeight = 1710 ScaleWidth = 1395 TabIndex = 3 Top = 270 Width = 1455 End Begin VB.PictureBox picDragFrom AutoRedraw = -1 'True AutoSize = -1 'True DragMode = 1 'Automatic Height = 1290 Index = 2 Left = 4680 Picture = "Drag.frx":7F96 ScaleHeight = 1230 ScaleWidth = 870 TabIndex = 2 Top = 510 Width = 930 End Begin VB.PictureBox picDragFrom AutoRedraw = -1 'True AutoSize = -1 'True DragMode = 1 'Automatic Height = 1110 Index = 1 Left = 3360 Picture = "Drag.frx":B838 ScaleHeight = 1050 ScaleWidth = 1155 TabIndex = 1 Top = 600 Width = 1215 End Begin VB.PictureBox picDragFrom AutoRedraw = -1 'True AutoSize = -1 'True DragMode = 1 'Automatic Height = 1590 Index = 0 Left = 0 Picture = "Drag.frx":D25A ScaleHeight = 1530 ScaleWidth = 1650 TabIndex = 0 Top = 360 Width = 1710 End Begin VB.Label Label1 Caption = "Drag to:" Height = 255 Index = 1 Left = 0 TabIndex = 7 Top = 2280 Width = 1215 End Begin VB.Label Label1 Caption = "Drag from:" Height = 255 Index = 0 Left = 0 TabIndex = 4 Top = 0 Width = 1215 End Attribute VB_Name = "frmDrag" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit ' When we enter the form, show the no drop cursor. Private Sub Form_DragOver(Source As Control, _ X As Single, Y As Single, State As Integer) If State = vbEnter Then Source.DragIcon = picNoDrop.Picture End If End Sub ' Display the no drop cursor. Private Sub picDragFrom_DragOver(Index As Integer, Source As Control, _ X As Single, Y As Single, State As Integer) If State = vbEnter Then Source.DragIcon = picNoDrop.Picture End If End Sub ' Get the dropped picture. Private Sub picDragTo_DragDrop(Index As Integer, Source As Control, _ X As Single, Y As Single) ' Make sure Source is as picDragFrom control. If Source.Name <> "picDragFrom" Then Exit Sub ' Copy the dropped picture. picDragTo(Index).Picture = Source.Picture End Sub ' When we drag over a picDragTo control, display ' the ok drop cursor if the source control has ' name picDragFrom. Otherwise display the no ' drop cursor. Private Sub picDragTo_DragOver(Index As Integer, Source As Control, _ X As Single, Y As Single, State As Integer) ' If we are entering the control, see if ' we know how to accept the drop. If State = vbEnter Then ' Verify that Source is a picDragFrom control. If Source.Name = "picDragFrom" Then ' This drop is ok. Source.DragIcon = picOkDrop.Picture Else Source.DragIcon = picNoDrop.Picture End If End If End Sub